using System;
using System.Collections;
using System.Reflection;

internal static class Class16
{
	private static readonly Hashtable hashtable_0 = Hashtable.Synchronized(new Hashtable(10240));

	private static readonly Hashtable hashtable_1 = Hashtable.Synchronized(new Hashtable(10240));

	internal static Interface1 smethod_0(PropertyInfo propertyInfo_0)
	{
		Interface1 @interface = (Interface1)Class16.hashtable_0[propertyInfo_0];
		if (@interface == null)
		{
			@interface = Class16.smethod_2(propertyInfo_0);
			Class16.hashtable_0[propertyInfo_0] = @interface;
		}
		return @interface;
	}

	internal static Interface2 smethod_1(PropertyInfo propertyInfo_0)
	{
		Interface2 @interface = (Interface2)Class16.hashtable_1[propertyInfo_0];
		if (@interface == null)
		{
			@interface = Class16.smethod_3(propertyInfo_0);
			Class16.hashtable_1[propertyInfo_0] = @interface;
		}
		return @interface;
	}

	public static Interface1 smethod_2(PropertyInfo propertyInfo_0)
	{
		if (propertyInfo_0 == null)
		{
			throw new ArgumentNullException("propertyInfo");
		}
		if (!propertyInfo_0.CanRead)
		{
			throw new InvalidOperationException("属性不支持读操作。");
		}
		MethodInfo getMethod = propertyInfo_0.GetGetMethod(true);
		if (getMethod.GetParameters().Length > 0)
		{
			throw new NotSupportedException("不支持构造索引器属性的委托。");
		}
		if (getMethod.IsStatic)
		{
			Type type = typeof(Class20<>).MakeGenericType(new Type[]
			{
				propertyInfo_0.PropertyType
			});
			return (Interface1)Activator.CreateInstance(type, new object[]
			{
				propertyInfo_0
			});
		}
		Type type2 = typeof(Class18<, >).MakeGenericType(new Type[]
		{
			propertyInfo_0.DeclaringType,
			propertyInfo_0.PropertyType
		});
		return (Interface1)Activator.CreateInstance(type2, new object[]
		{
			propertyInfo_0
		});
	}

	public static Interface2 smethod_3(PropertyInfo propertyInfo_0)
	{
		if (propertyInfo_0 == null)
		{
			throw new ArgumentNullException("propertyInfo");
		}
		if (!propertyInfo_0.CanWrite)
		{
			throw new NotSupportedException("属性不支持写操作。");
		}
		MethodInfo setMethod = propertyInfo_0.GetSetMethod(true);
		if (setMethod.GetParameters().Length > 1)
		{
			throw new NotSupportedException("不支持构造索引器属性的委托。");
		}
		if (setMethod.IsStatic)
		{
			Type type = typeof(Class21<>).MakeGenericType(new Type[]
			{
				propertyInfo_0.PropertyType
			});
			return (Interface2)Activator.CreateInstance(type, new object[]
			{
				propertyInfo_0
			});
		}
		Type type2 = typeof(Class19<, >).MakeGenericType(new Type[]
		{
			propertyInfo_0.DeclaringType,
			propertyInfo_0.PropertyType
		});
		return (Interface2)Activator.CreateInstance(type2, new object[]
		{
			propertyInfo_0
		});
	}
}
